<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/admin/head.html"/>
<script type="text/javascript">
var perms = [<#list perms as p>"${p}"<#if p_has_next>,</#if></#list>];
function disablePerms() {
	if($("input[name=super]:checked").val()=="true") {
		$(".perm-container input[type=checkbox]").attr("disabled","disabeld");
	} else {
		$(".perm-container input[type=checkbox]").removeAttr("disabled");
	}
}
$(function() {
	disablePerms();
	$("#jvForm").validate();
	$(".perm-container input[type=checkbox]").each(function() {
		var perm = $(this).val();
		var index = perm.indexOf(",");		
		if(index!=-1) {
			perm = perm.substring(0,index);
		}
		for(var i=0,len=perms.length;i<len;i++) {
			if(perms[i]==perm) {
				$(this).attr("checked",true);
				break;
			}
		}
	});
	$("input[name=isSuper]").bind("click",function(){
		disablePerms();
	});
});
</script>
 

<style type="text/css">
.perm-container{}
.perm-layout-1{padding:3px 0;}
.perm-layout-2{padding-left:30px;}
</style>

</head>
<body>

<div class="box-positon">
	<div class="rpos">当前位置:  角色 - 编辑</div>
	<form class="ropt">
		<input type="button" value="返回列表" onclick="history.back();"/>
	</form>
	<div class="clear"></div>
</div>
<div class="body-box">
<form method="post" action="o_troleSave.do" id="jvForm">
<table width="100%" class="pn-ftable" cellpadding="2" cellspacing="1" 	border="0">

   <input type="hidden" name="roleid" id="roleid" value="${trole.roleid!?html}"/>
<tr>
		<td width="12%" class="pn-flabel pn-flabel-h">     角色名称:
     </td>
		<td  width="38%" class="pn-fcontent"> <input type="text" name="rolename"  id="rolename" maxlength="100" size="24"
 class="" value="${trole.rolename!?html}" /></td>
           </tr> 
           
         <tr><td width="12%" class="pn-flabel pn-flabel-h">拥有所有权限:</td><td    class="pn-fcontent"><label><input type="radio" value="1" <#if "1"==trole.isSuper!> checked</#if> name="isSuper"/>是</label> <label><input type="radio" value="0"  <#if "0"==trole.isSuper!> checked</#if>   name="isSuper"/>否</label></td>
</tr>
     
     
     <tr><td width="12%" class="pn-flabel pn-flabel-h">功能权限:</td><td   width="85%" class="pn-fcontent">
<div class="perm-container">



<!--公共路径 -->
<input type="hidden" name="perms" value="/blank1.do,/blank.do,/index.do,/top.do,/main.do,/left.do,/right.do,/map.do"/>

  
<div class="perm-layout-1">
<label><input value="/memberManage.do,/memberManageLeft.do" type="checkbox" name="perms"/>会员管理</label>
<div>
	<div class="perm-layout-2">
	<label><input value="/v_tmemberAdd.do,/o_tmemberSave.do" type="checkbox" name="perms"/>实名登记</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_tmemberList.do,/v_tmemberAdd.do,/o_tmemberSave.do,/o_tmemberDelete.do" type="checkbox" name="perms"/>会员管理</label>
	</div>
</div>
</div>

<div class="perm-layout-1">
<label><input value="/infoManage.do,/infoManageLeft.do" type="checkbox" name="perms"/>信息管理</label>
<div>
	<div class="perm-layout-2">
	<label><input value="/v_tinfoList.do" type="checkbox" name="perms"/>今日发布,交通状况,警方提醒,防范支招,请您协助,交通管制,计划事件,突发事件,青少年警讯,通缉令</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_tinfoListWorkGuide.do" type="checkbox" name="perms"/>办事指南</label>
	</div>
	 <div class="perm-layout-2">
	<label><input value="/v_ttopicList.do" type="checkbox" name="perms"/>警务论坛管理</label>
	</div>	
	<div class="perm-layout-2">
	<label><input value="/v_tflashList.do" type="checkbox" name="perms"/>视频快照管理</label>
	</div>
</div>
</div> 

<div class="perm-layout-1">
<label><input value="/collectManage.do,/collectManageLeft.do" type="checkbox" name="perms"/>数据采集</label>
<div>
	<div class="perm-layout-2">
	<label><input value="/v_tmembernewsList.do,/v_tmembernewsAdd.do,/o_tmembernewsSave.do,/v_tmembernewsDelete.do,/v_tmembernewsDetail.do,/v_tmembernewsEdit.do" type="checkbox" name="perms"/>我要爆料</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_trentList.do,/v_trentAdd.do,/o_trentSave.do,/o_trentDelete.do,/v_trentDetail.do,/v_trentEdit.do" type="checkbox" name="perms"/>租住申报</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_tcompanyList.do,/v_tcompanyAdd.do,/o_tcompanySave.do,/o_tcompanyDelete.do,/v_tcompanyDetail.do,/v_tcompanyEdit.do" type="checkbox" name="perms"/>行业场所信息</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_tsuggestionList.do,/v_tsuggestionAdd.do,/o_tsuggestionSave.do,/o_tsuggestionDelete.do,/v_tsuggestionDetail.do,/v_tsuggestionEdit.do" type="checkbox" name="perms"/>意见建议</label>
	</div>
	 
	 	<div class="perm-layout-2">
	<label><input value="/v_talarmList.do,/v_talarmAdd.do,/o_talarmSave.do,/o_talarmDelete.do,/v_talarmDetail.do,/v_talarmEdit.do" type="checkbox" name="perms"/>一键报警</label>
	</div>
	
		<div class="perm-layout-2">
	<label><input value="/v_tworkerList.do,/v_tworkerAdd.do,/o_tworkerSave.do,/o_tworkerDelete.do,/v_tworkerDetail.do,/v_tworkerEdit.do" type="checkbox" name="perms"/>从业人员</label>
	</div>
	
		<div class="perm-layout-2">
	<label><input value="/v_tcommentList.do,/v_tcommentAdd.do,/o_tcommentSave.do,/o_tcommentDelete.do,/v_tcommentDetail.do,/v_tcommentEdit.do" type="checkbox" name="perms"/>民意警务意见采集</label>
	</div>
		
		<div class="perm-layout-2">
	<label><input value="/v_tcomplaintList.do,/v_tcomplaintAdd.do,/o_tcomplaintSave.do,/o_tcomplaintDelete.do,/v_tcomplaintDetail.do,/v_tcomplaintEdit.do" type="checkbox" name="perms"/>民意警务网上投诉</label>
	</div>
		
		<div class="perm-layout-2">
	<label><input value="/v_tresidenceList.do,/v_tresidenceAdd.do,/o_tresidenceSave.do,/o_tresidenceDelete.do,/v_tresidenceDetail.do,/v_tresidenceEdit.do" type="checkbox" name="perms"/>居住证网上办理</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_tsurveyquestionList.do" type="checkbox" name="perms"/>民意测评问卷管理</label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_tsurveypartnerList.do" type="checkbox" name="perms"/>民意测评查看结果</label>
	</div>
	
</div>
</div> 

<div class="perm-layout-1">
<label><input value="/sysManage.do,/sysManageLeft.do" type="checkbox" name="perms"/>系统管理 </label>
<div>
	<div class="perm-layout-2">
	<label><input value="/v_tuserList.do,/v_tuserAdd.do,/o_tuserSave.do,/o_tuserDelete.do" type="checkbox" name="perms"/>系统用户 </label>
	</div>
	<div class="perm-layout-2">
	<label><input value="/v_troleList.do,/v_troleAdd.do,/o_troleSave.do,/o_troleDelete.do" type="checkbox" name="perms"/>角色管理  </label>
	</div>	 
	<div class="perm-layout-2">
	<label><input value="/v_tservicelogList.do" type="checkbox" name="perms"/>接口日志</label>
	</div>	
</div>
</div> 


</div>
<script type="text/javascript">
$(function() {
	$(".perm-container input[type=checkbox]").bind("click",function() {
		parentCheck(this);
		childCheck(this);
	});
});
function parentCheck(chk) {
	var obj = $(chk).parent().parent().parent();
	while(obj && obj.attr("class").indexOf("perm-container")==-1) {
		if(chk.checked) {
			$(obj.children()[0]).children().attr("checked",true);
		}
		obj = obj.parent();
	}
}
function childCheck(chk) {
	$(chk).parent().next().children().find("input[type=checkbox]").each(function(){this.checked=chk.checked});
}
</script>
</td></tr>



     
     
	<tr>
		<td colspan="2" class="pn-fbutton"><input type="submit"  
			value="提交" /> &nbsp; <input type="reset" value="重置" /></td>
	</tr>
</table>
</form>
</div>
</body>
</html>